package a.i;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.WeakHashMap;

public class vb
  extends Properties
{
  private PropertyChangeSupport a;
  private static vb b = new vb();
  private Map c;
  private String d = "profile";
  private String e;
  private String f;
  private File g;
  private ib h;
  public static boolean i;
  
  private vb()
  {
    k();
    this.a = new PropertyChangeSupport(this);
    this.c = new WeakHashMap();
  }
  
  protected static void a(vb paramvb)
  {
    if (!p.b) {
      if (paramvb == null) {
        throw new NullPointerException("Cannot install null instance.");
      }
    }
    b = paramvb;
  }
  
  public void a(Object paramObject, hb paramhb)
  {
    this.c.put(paramObject, paramhb);
  }
  
  public void a(Object paramObject)
  {
    hb localhb = (hb)this.c.get(paramObject);
    if ((p.b) || (localhb != null)) {
      localhb.a(paramObject, this, this.h);
    }
  }
  
  public void b(Object paramObject)
  {
    hb localhb = (hb)this.c.get(paramObject);
    if ((p.b) || (localhb != null)) {
      localhb.b(paramObject, this, this.h);
    }
  }
  
  public void a()
  {
    boolean bool = p.a;
    Iterator localIterator = this.c.entrySet().iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      ((hb)localEntry.getValue()).a(localEntry.getKey(), this, this.h);
    } while (!bool);
  }
  
  public void b()
  {
    boolean bool = p.a;
    Iterator localIterator = this.c.entrySet().iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      ((hb)localEntry.getValue()).b(localEntry.getKey(), this, this.h);
    } while (!bool);
  }
  
  public void c()
    throws IOException
  {
    a(h());
  }
  
  public String d()
  {
    return this.f;
  }
  
  public void a(String paramString)
  {
    this.f = paramString;
  }
  
  public String e()
  {
    return this.e;
  }
  
  public void b(String paramString)
  {
    this.e = paramString;
  }
  
  public String f()
  {
    return this.d;
  }
  
  public void c(String paramString)
  {
    this.d = paramString;
  }
  
  public File g()
  {
    return this.g;
  }
  
  public void a(File paramFile)
  {
    this.g = paramFile;
  }
  
  protected URL h()
  {
    return kb.a(this.d, this.e, this.f);
  }
  
  public void i()
    throws IOException
  {
    URL localURL = h();
    File localFile;
    if (localURL != null)
    {
      localFile = new File(localURL.getFile());
      if (p.b) {
        return;
      }
      if (!p.a) {}
    }
    else
    {
      localFile = g();
    }
    b(localFile);
  }
  
  public void a(URL paramURL)
    throws IOException
  {
    if ((p.b) || (paramURL != null))
    {
      InputStream localInputStream = paramURL.openStream();
      if (localInputStream != null) {
        super.load(localInputStream);
      }
    }
  }
  
  public void b(File paramFile)
    throws IOException
  {
    boolean bool = p.b;
    if (!bool) {
      if (paramFile != null)
      {
        if (!bool) {
          if (paramFile.exists())
          {
            if (bool) {
              break label115;
            }
            if (!paramFile.canWrite()) {
              break label114;
            }
          }
        }
        if ((bool) || ((!paramFile.getParentFile().exists()) && (!paramFile.getParentFile().mkdirs()))) {
          throw new IOException("Could not create parent directory. " + paramFile.getParentFile());
        }
        FileOutputStream localFileOutputStream = new FileOutputStream(paramFile);
        super.store(localFileOutputStream, "yFiles GlobalProperties");
        localFileOutputStream.close();
      }
    }
    label114:
    if ((p.a) && (paramFile != null)) {
      label115:
      throw new IOException("File not writable! " + paramFile.toString());
    }
  }
  
  public void a(PropertyChangeListener paramPropertyChangeListener)
  {
    this.a.addPropertyChangeListener(paramPropertyChangeListener);
  }
  
  public void b(PropertyChangeListener paramPropertyChangeListener)
  {
    this.a.removePropertyChangeListener(paramPropertyChangeListener);
  }
  
  public void a(String paramString, PropertyChangeListener paramPropertyChangeListener)
  {
    this.a.addPropertyChangeListener(paramString, paramPropertyChangeListener);
  }
  
  public void b(String paramString, PropertyChangeListener paramPropertyChangeListener)
  {
    this.a.removePropertyChangeListener(paramString, paramPropertyChangeListener);
  }
  
  public static vb j()
  {
    return b;
  }
  
  public Object put(Object paramObject1, Object paramObject2)
  {
    boolean bool = p.b;
    if (((!bool) && (paramObject2 == null)) || ((paramObject2 instanceof String)))
    {
      str = getProperty((String)paramObject1);
      if (!bool) {
        if (paramObject2 == null)
        {
          localObject = super.remove(paramObject1);
          if (bool) {
            break label78;
          }
          if (!p.a) {
            break label65;
          }
        }
      }
      Object localObject = super.put(paramObject1, paramObject2);
      label65:
      this.a.firePropertyChange((String)paramObject1, str, paramObject2);
      label78:
      return localObject;
    }
    String str = k().a(paramObject2, paramObject2.getClass());
    return setProperty((String)paramObject1, str);
  }
  
  public jb k()
  {
    if (this.h == null) {
      this.h = ib.c();
    }
    return this.h;
  }
  
  public Object a(String paramString, Class paramClass)
  {
    String str = getProperty(paramString);
    if ((p.b) || (str != null)) {
      return k().a(str, paramClass);
    }
    return null;
  }
  
  public void a(String paramString, boolean paramBoolean)
  {
    String str = k().a(paramBoolean ? Boolean.TRUE : Boolean.FALSE, Boolean.TYPE);
    setProperty(paramString, str);
  }
  
  public void a(String paramString, float paramFloat)
  {
    String str = k().a(new Float(paramFloat), Float.TYPE);
    setProperty(paramString, str);
  }
  
  public void a(String paramString, double paramDouble)
  {
    String str = k().a(new Float(paramDouble), Double.TYPE);
    setProperty(paramString, str);
  }
  
  public void a(String paramString, int paramInt)
  {
    String str = k().a(new Integer(paramInt), Integer.TYPE);
    setProperty(paramString, str);
  }
  
  public void a(String paramString, byte paramByte)
  {
    String str = k().a(new Byte(paramByte), Byte.TYPE);
    setProperty(paramString, str);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.i.vb

 * JD-Core Version:    0.7.0.1

 */